<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>location对象</title>
    
</head>
<body>
    <form>
        <input type="text" name="user">
        <input type="password" name="pwd">
        <input type="submit">
    </form>
    <script type="text/javascript">
        // IP地址:端口
        console.log(location.hsot);
        // IP地址
        console.log(location.hostname);
        // 完整url
        console.log(location.href);
        console.log(decodeURI(location.href));
        // 文件路径 
        console.log(decodeURI(location.pathname));
        // 端口
        console.log(location.prot);
        // 协议
        console.log(location.protocol);
        // 搜索
        console.log(location.search);
    </script>
</body>
</html>